Questions
2 of 13
1What role does Qdrant play in a typical RAG architecture, and what happens on either side of it in the pipeline?
2How would you design chunking and metadata so that retrieved chunks can be traced back to their source document and section for citation?
3A RAG system is returning chunks that are topically related but don't actually answer the user's question. How would you improve retrieval quality?
4How would you handle access control in a RAG system where different users are only permitted to retrieve chunks from documents they have permission to view?
5Why might you keep conversation-turn embeddings in a separate, short-lived collection rather than mixing them into your main document knowledge base?
6How would you model 'users who liked this also liked' recommendations using Qdrant's recommend/discovery query modes?
7How would you incorporate business signals like popularity or recency into a similarity-based recommendation without abandoning vector search entirely?
8What cold-start problem exists for a new item or new user in a vector-similarity recommendation system, and how might you mitigate it?
9How would you evaluate whether a change to your recommendation retrieval pipeline actually improved results, before rolling it out to all users?
10Design a Qdrant-backed search feature for a SaaS product with thousands of small customers, each with their own private dataset. What collection and sharding strategy would you use?
11One large enterprise tenant has 100x more data than a typical tenant in your shared multitenant collection. What problems could this cause, and how would you address them?
12How would you offer per-tenant usage metrics (storage, query volume) in a shared multitenant Qdrant deployment?
13What is the tradeoff of offering tenants a 'bring your own embedding model' option in a shared collection?
02 / 13

How would you design chunking and metadata so that retrieved chunks can be traced back to their source document and section for citation?

Deterministic chunk IDs plus document, section, page, and offset metadata

The design has two parts: a chunk ID scheme that is deterministic and traceable, and a payload schema that carries the provenance. The chunk ID should be derived from the source document and the chunk's position within it, e.g. '{document_id}::{chunk_index}' or a hash of the document ID plus the chunk's character offset. A deterministic ID makes upserts idempotent, so re-processing a document overwrites the existing chunks rather than duplicating them. The payload should carry at minimum: document_id, chunk_index, section (heading or logical section), page (if the source has pagination), start_offset and end_offset (character or token offsets within the source), and the source URI or an object-storage key. It should also carry the chunk text itself, because the generation stage needs the text to build the prompt and does not want to fetch it from a separate store. Document-level metadata (title, publication date, category, access permissions, tenant) should be replicated on every chunk so that filters on document-level attributes work without a join.

The mechanism that makes this work is that the payload is the only information the retrieval stage has about the chunk's origin. When the LLM cites a source, the application needs to map the retrieved chunk back to a human-readable location in the original document. The section and page fields let the application say 'see section 3.2, page 12', which is far more useful than a raw chunk index. The offset fields let the application highlight the exact span of text in a viewer. The document_id lets the application deduplicate - if three chunks from the same document are retrieved, the application can show the document once with the relevant sections highlighted. The replicated document metadata means the retrieval filter can be applied at the chunk level without a separate lookup: a query that filters by tenant or publication date works directly on the chunk collection. This is why the payload schema must be designed before ingestion starts - adding fields later requires re-ingesting the corpus.

  1. 1

    Chunk ID: deterministic, derived from document ID and chunk index or offset.

  2. 2

    document_id: stable identifier for the source document.

  3. 3

    chunk_index: position within the document, used for ordering and reconstruction.

  4. 4

    section: heading or logical section name for human-readable citation.

  5. 5

    page: page number if the source has pagination (PDF, printed docs).

  6. 6

    start_offset / end_offset: character or token offsets within the source for highlighting.

  7. 7

    chunk_text: the chunk's text, so the generation stage does not need a separate lookup.

  8. 8

    source_uri: a link to the original document for the user to open.

  9. 9

    document-level metadata replicated: title, date, category, permissions, tenant.

  10. 10

    Index the filterable fields: document_id, date, category, permissions, tenant.

The trade-off is between payload richness and payload size. Every field in the payload adds storage and, if indexed, memory and write cost. Replicating document-level metadata on every chunk multiplies the metadata storage by the average number of chunks per document, which for a corpus with long documents can be significant. The chunk text itself is the largest field; storing it in the payload is convenient but increases payload size. An alternative is to store the chunk text in a separate store and put a reference in the payload, but that adds a lookup step and a dependency during generation. In practice, storing the chunk text in the payload is the right default because the generation stage needs it immediately, and the alternatives add complexity without a clear benefit. The common mistake is to not store enough metadata to support citation, so the answers cannot be verified. The second mistake is to use non-deterministic chunk IDs, so re-processing creates duplicates. The third mistake is to not replicate document-level metadata on chunks, so filters on document attributes do not work. The fourth mistake is to store the chunk text only as a reference, adding a lookup that the generation stage has to perform under latency pressure. Version note: the payload index types (keyword, datetime, integer, etc.) and the is_tenant flag have evolved across Qdrant releases; design the schema with the version's capabilities in mind, and consider which fields need indexes based on the filter patterns you expect.

javascript

Version-dependent: the payload index types and the API for creating them have changed across Qdrant releases. The is_tenant flag and the on_disk option for indexes are recent additions. The query_points and upsert API shape is qdrant-client 1.10+. If you are on an older version, verify which payload schema types are available before designing the schema.

Difficulty: 7/10
Topics: Chunking, Payload Schema, RAG, Citation

Scenario Questions

0-2 years experience
  1. 1

    You ingest documents and later cannot tell which chunks came from which document. Explain the metadata you forgot and how to add it.

  2. 2

    A teammate uses a random UUID for each chunk. Explain why that is a problem for updates and how deterministic IDs fix it.

2-5 years experience
  1. 1

    You need to support citations that say 'see page 12, section 3.2'. Describe the payload fields and how the generation stage uses them.

  2. 2

    A document is updated and re-ingested. Describe how the chunk IDs and metadata handle the update without duplicating chunks.

5-8 years experience
  1. 1

    Design a chunking and metadata strategy for a corpus of PDFs, HTML pages, and structured documents, supporting citation at the section and page level.

  2. 2

    You need to support a UI that highlights the exact sentence that answered the question. Describe the metadata and the retrieval-to-UI flow.

8+ years experience
  1. 1

    You are designing a RAG system for legal documents where citations must be exact and auditable. Describe the chunking, metadata, and validation that make every citation verifiable.

  2. 2

    A document is re-ingested with a new version and old citations become invalid. Describe the versioning strategy that preserves citation stability across document updates.

Follow-up Questions

  • How would you handle a document that is updated after ingestion, so that chunks are added, removed, and re-ordered?
  • What metadata would you add to support highlighting the exact sentence that answered the question in a document viewer?